#include <iostream>
#include <string>
using namespace std;

const int kMaxN = 5010;

bool diff[kMaxN], status[kMaxN];

int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    string s;

    cin >> s;
    if (s == "F") {
      status[i] = true;
    } else {
      status[i] = false;
    }
  }

  int minm = n, mink = 1;

  status[0] = true;
  for (int k = 1; k <= n; k++) {
    for (int i = 1; i <= n + 1; i++) {
      diff[i] = status[i] ^ status[i - 1];
    }
    int m = 0;
    bool now = true;
    for (int i = 1; i <= n - k + 1; i++) {
      now ^= diff[i];
      if (now) {
        continue;
      } else {
        m++;
        now ^= true;
        diff[i + k] ^= true;
      }
    }
    for (int i = n - k + 2; i <= n; i++) {
      now ^= diff[i];
      if (now) {
        continue;
      } else {
        m = n;
        break;
      }
    }
    if (m < minm) {
      minm = m;
      mink = k;
    }
  }
  cout << mink << " " << minm << "\n";
  return 0;
}